home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 40
/
Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso
/
Aminet
/
misc
/
emu
/
ATUtilities.lha
/
ATUtilities
/
play.c
< prev
next >
Wrap
C/C++ Source or Header
|
2000-09-26
|
3KB
|
116 lines
#include <exec/types.h>
VOID Auswahl();
struct GfxBase *GfxBase;
struct IntuitionBase *IntuitionBase;
struct ATUtilitiesBase *ATUtilitiesBase;
struct DiskfontBase *DiskfontBase;
VOID main(argc,argv)
LONG argc;
UBYTE *argv[];
{
GfxBase=OpenLibrary("graphics.library",0L);
IntuitionBase=OpenLibrary("intuition.library",0L);
DiskfontBase=OpenLibrary("diskfont.library",0L);
ATUtilitiesBase=OpenLibrary("at-utilities.library",0L);
if((DiskfontBase!=NULL)&&(ATUtilitiesBase!=NULL))
{
Auswahl();
Auswahl();
}
if(ATUtilitiesBase) CloseLibrary(ATUtilitiesBase);
if(DiskfontBase) CloseLibrary(DiskfontBase);
exit(0);
}
struct E
{
UWORD HiFiPlayerWait;
UBYTE HiFiPlayerNum;
UBYTE HiFiPlayerAutoStart;
UBYTE HiFiPlayerWaitActive;
};
#define YES 1
struct E Einstellungen=
{
60,
0,
YES,
YES,
};
/* HiFi-Player Auswahl */
UBYTE *PlayerNames[]={"ATUtilities HiFi-Player",
"Externer Player 1",
"Externer Player 2",
"Externer Player 3"};
VOID Auswahl()
{
UBYTE *vz;
UBYTE str[8];
REGISTER BOOL ende;
REGISTER ULONG Class;
register struct Gadget *gad,*autos,*verz;
register struct Window *win;
register struct RastPort *rp;
register struct IntuiMessage *msg;
win=CreateStdWindow("HiFi-Play - Auswahl",75,75,450,90,
CLOSEWINDOW|GADGETUP,
ACTIVATE|WINDOWDEPTH|WINDOWDRAG|WINDOWCLOSE);
if(win!=NULL)
{
rp=win->RPort;
SetFont(rp,GetOpalFont());
CreateBoolGadget(win,15,15,25,12,"»",1);
DrawNTextBorder(win,45,15,390,12,PlayerNames[Einstellungen.HiFiPlayerNum]);
if(Einstellungen.HiFiPlayerAutoStart!=0)
autos=CreateSToggleGadget(win,15,40,420,12,"Auto-Start durch ATKeyboard",20);
else
autos=CreateNToggleGadget(win,15,40,420,12,"Auto-Start durch ATKeyboard",20);
if(Einstellungen.HiFiPlayerWaitActive!=0)
verz=CreateSToggleGadget(win,15,55,420,12,"Verzögerung des Auto-Starts",30);
else
verz=CreateNToggleGadget(win,15,55,420,12,"Verzögerung des Auto-Starts",30);
sprintf(&str,"%ld",Einstellungen.HiFiPlayerWait);
vz=CreateIntegerGadget(win,385,70,50,12,&str,5,10);
SelectStdFPen(rp);
WriteText(rp,25,78,"Verzögerung in Sekunden:");
ende=FALSE;
while(ende==FALSE)
{
WaitPort(win->UserPort);
msg=GetMsg(win->UserPort);
Class=msg->Class;
gad=msg->IAddress;
ReplyMsg(msg);
switch(Class)
{
case CLOSEWINDOW:
ende=TRUE;
break;
case GADGETUP:
switch(gad->GadgetID)
{
case 1:
Einstellungen.HiFiPlayerNum+=1;
if(Einstellungen.HiFiPlayerNum>3) Einstellungen.HiFiPlayerNum=0;
DrawCNTextBorder(win,45,15,390,12,PlayerNames[Einstellungen.HiFiPlayerNum]);
break;
}
break;
}
}
if(autos->Flags & SELECTED) Einstellungen.HiFiPlayerAutoStart=1; else Einstellungen.HiFiPlayerAutoStart=0;
if(verz->Flags & SELECTED) Einstellungen.HiFiPlayerWaitActive=1; else Einstellungen.HiFiPlayerWaitActive=0;
Einstellungen.HiFiPlayerWait=atol(vz);
DeleteStdWindow(win);
}
}